package com.yzyz.utils.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.yzyz.bean.scenic.PictureBean;

public class PictureRowMapper implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int arg1) throws SQLException {
		PictureBean p = new PictureBean();
		p.setAvailable(rs.getBoolean("available"));
		p.setContents(rs.getBytes("contents"));
		p.setDate(new Date(rs.getTimestamp("date").getTime()));
		p.setOwnerId(rs.getInt("ownerId"));
		p.setId(rs.getInt("id"));
		p.setDescription(rs.getString("description"));
		return p;
	}

}
